/* Copyright 2008 Bas van den Berg
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <string>

#include "ParserFactory.h"
#include "VerbParser.h"
#include "Commands.h"
#include "AdminCommands.h"

using namespace Chronos;
using namespace std;


Parser* ParserFactory::create() {
    VerbParser* parser = new VerbParser(*new MyDefaultCommand());

    parser->addCommand("help", "", VerbParser::VERB, new HelpCommand());

    parser->addCommand("look", "", VerbParser::VERB, new LookCommand());
    parser->addCommand("look", "at", VerbParser::VERB_ADJ_OBJ, new LookAtCommand());
    
    parser->addCommand("greet", "", VerbParser::VERB_OBJ, new GreetCommand());
    parser->addCommand("who", "", VerbParser::VERB, new WhoCommand());
    parser->addCommand("say", "", VerbParser::VERB_OBJ, new SayCommand());
	parser->addCommand("tell", "", VerbParser::VERB_OBJ_OBJ, new TellCommand());

    parser->addCommand("attack", "", VerbParser::VERB_OBJ, new AttackCommand());
    
    parser->addCommand("quit", "", VerbParser::VERB, new QuitCommand());
    parser->addCommand("date", "", VerbParser::VERB, new DateCommand());
    parser->addCommand("password", "", VerbParser::VERB_OBJ, new ChangePasswordCommand());
    
    parser->addCommand("north", "", VerbParser::VERB, new NorthCommand());
    parser->addCommand("east", "", VerbParser::VERB, new EastCommand());
    parser->addCommand("south", "", VerbParser::VERB, new SouthCommand());
    parser->addCommand("west", "", VerbParser::VERB, new WestCommand());
    parser->addCommand("up", "", VerbParser::VERB, new UpCommand());
    parser->addCommand("down", "", VerbParser::VERB, new DownCommand());

    parser->addCommand("status", "", VerbParser::VERB, new StatusCommand());

    parser->addCommand("open", "", VerbParser::VERB_OBJ, new OpenCommand());
    parser->addCommand("close", "", VerbParser::VERB_OBJ, new CloseCommand());
    parser->addCommand("lock", "with", VerbParser::VERB_OBJ_ADJ_OBJ, new LockCommand());
    parser->addCommand("unlock", "with", VerbParser::VERB_OBJ_ADJ_OBJ, new UnlockCommand());
    parser->addCommand("push", "", VerbParser::VERB_OBJ, new PushCommand());
	
    parser->addCommand("get", "", VerbParser::VERB_OBJ, new PickupCommand());
    parser->addCommand("drop", "", VerbParser::VERB_OBJ, new DropCommand());

    parser->addCommand("inv", "", VerbParser::VERB, new InventoryCommand());
    parser->addCommand("dispose", "", VerbParser::VERB_OBJ, new DisposeCommand());

    parser->addCommand("put", "in", VerbParser::VERB_OBJ_ADJ_OBJ, new PutInCommand());
    parser->addCommand("get", "from", VerbParser::VERB_OBJ_ADJ_OBJ, new GetFromCommand());

    parser->addCommand("drink", "", VerbParser::VERB_OBJ, new DrinkCommand());
    parser->addCommand("eat", "", VerbParser::VERB_OBJ, new EatCommand());
    
    parser->addCommand("wear", "", VerbParser::VERB_OBJ, new WearCommand());
    parser->addCommand("remove", "", VerbParser::VERB_OBJ, new UnwearCommand());
    parser->addCommand("remove", "all", VerbParser::VERB_ADJ, new UnwearAllCommand());
    parser->addCommand("equip", "", VerbParser::VERB, new ShowEquipCommand());

	parser->addCommand("alias", "", VerbParser::VERB_OBJ_OBJ, new AliasCommand());
	parser->addCommand("unalias", "", VerbParser::VERB_OBJ, new UnAliasCommand());
	parser->addCommand("aliaslist", "", VerbParser::VERB, new AliasListCommand());

	parser->addCommand("settings", "", VerbParser::VERB, new SettingsCommand());
	parser->addCommand("set", "", VerbParser::VERB_OBJ_OBJ, new SetCommand());

	parser->addCommand("comm", "", VerbParser::VERB, new CommCommand());
	parser->addCommand("comm", "list", VerbParser::VERB_ADJ, new CommListCommand());
    parser->addCommand("[", "", VerbParser::VERB_OBJ_OBJ, new CommChatCommand());
	parser->addCommand("comm", "join", VerbParser::VERB_ADJ_OBJ, new CommJoinCommand());
	parser->addCommand("comm", "leave", VerbParser::VERB_ADJ_OBJ, new CommLeaveCommand());
	parser->addCommand("comm", "show", VerbParser::VERB_ADJ_OBJ, new CommShowCommand());
	parser->addCommand("comm", "create", VerbParser::VERB_ADJ_OBJ, new CommCreateCommand());

	parser->addCommand("prompt", "", VerbParser::VERB_OBJ, new PromptCommand());

	parser->addCommand("search", "", VerbParser::VERB, new SearchCommand());
	parser->addCommand("stop", "", VerbParser::VERB, new StopCommand());

    parser->addCommand("trade", "", VerbParser::VERB, new TradeHelpCommand());
    parser->addCommand("trade", "with", VerbParser::VERB_ADJ_OBJ, new TradeStartCommand());
    parser->addCommand("trade", "stop", VerbParser::VERB_ADJ, new TradeStopCommand());
    parser->addCommand("trade", "accept", VerbParser::VERB_ADJ, new TradeAcceptCommand());
    parser->addCommand("trade", "add", VerbParser::VERB_ADJ_OBJ, new TradeItemCommand());
    parser->addCommand("trade", "credits", VerbParser::VERB_ADJ_OBJ, new TradeCreditsCommand());
    parser->addCommand("trade", "show", VerbParser::VERB_ADJ, new TradeShowCommand());
    parser->addCommand("trade", "see", VerbParser::VERB_ADJ_OBJ, new TradeSeeCommand());

	parser->addCommand("played", "", VerbParser::VERB, new PlayedCommand());

	parser->addCommand("@area", "list", VerbParser::VERB_ADJ, new AreaListCommand());
    parser->addCommand("@room", "list", VerbParser::VERB_ADJ_OBJ, new RoomListCommand());
    parser->addCommand("@server", "", VerbParser::VERB, new ServerCommand());
    parser->addCommand("@kills", "", VerbParser::VERB, new KillsCommand());

    return parser;
}


